home *** CD-ROM | disk | FTP | other *** search
- Path: abcfd20.larc.nasa.gov!amiga-request
- From: amiga-request@abcfd20.larc.nasa.gov (Amiga Sources/Binaries Moderator)
- Subject: v90i275: MIDIstuff 1.0 - midi tool package, Part01/01
- Reply-To: "Carlo 'Lynx' v. Loesch " <loesch@lan.informatik.tu-muenchen.dbp.de>
- Newsgroups: comp.sources.amiga
- Message-ID: <comp.sources.amiga:v90i275@abcfd20.larc.nasa.gov>
- Date: 11 Oct 90 00:14:31 GMT
- Approved: tadguy@uunet.UU.NET (Tad Guy)
- X-Mail-Submissions-To: amiga@uunet.uu.net
- X-Post-Discussions-To: comp.sys.amiga
-
- Submitted-by: "Carlo 'Lynx' v. Loesch " <loesch@lan.informatik.tu-muenchen.dbp.de>
- Posting-number: Volume 90, Issue 275
- Archive-name: midi/midistuff-1.0/part01
-
- [ a uuencoded private library and two power window files enclosed.
- see comp.binaries.amiga for executables ...tad ]
-
- This is the MIDIstuff package, 4 modules that make use of the MidiLib.
- MIDIkeys displays incoming notes on a piano keyboard and simulates a
- piano keyboard on the Amiga keyboard. MIDIrec is a simple MIDI
- Recorder, very simple, MIDIdump is a very simple SystemExclusive
- storage utility and the MIDIclock is an unreliable Clock generator :-)
-
- #!/bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 1 (of 1)."
- # Contents: PRO_README README lib lib/ynx.lib.uu src src/ClockPOW.c
- # src/MAKEFILE src/MIDIclock.c src/MIDIclock.uu src/MIDIdump.c
- # src/MIDIkeys.c src/MIDIrec.POW.uu src/MIDIrec.c src/RecPOW.c
- # Wrapped by tadguy@abcfd20 on Wed Oct 10 20:14:29 1990
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'PRO_README' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'PRO_README'\"
- else
- echo shar: Extracting \"'PRO_README'\" \(3310 characters\)
- sed "s/^X//" >'PRO_README' <<'END_OF_FILE'
- XM I D I S T U F F
- X~ ~ ~ ~ ~ ~ ~ ~ ~
- X
- X Release 1.0 - - - MIDIstuff part I - - - Date: 16 Aug 1990
- X PROGRAMMER'S README
- X
- XList of files the sources package should include:
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- XREADME Same as with binaries package
- XPRO_README Additional info and copyright notice
- X
- Xlib Compiler libraries used with MIDIstuff, MANX library format.
- Xlib/ynx.lib Some simple routines of mine, sources can be obtained from me.
- X The MIDI.lib and A.lib (ARP) are *not* included here, get
- X yourself the current releases of it, and hope my stuff
- X cooperates! :-)
- X
- Xsrc/ClockPOW.c Powerwindows output of MIDIclock.POW
- Xsrc/MAKEFILE
- Xsrc/MIDIclock.c
- Xsrc/MIDIclock.POW Powerwindows file for MIDIclock
- Xsrc/MIDIdump.c
- Xsrc/MIDIkeys.c
- Xsrc/MIDIrec.c
- Xsrc/MIDIrec.POW Powerwindows file for MIDIrec
- Xsrc/RecPOW.c Powerwindows output of MIDIrec.POW
- X
- XCOPYRIGHT NOTICE
- X The sources package is placed into freeware, which in my eyes means that
- X you are free to use and copy the package and modify it for own private
- X purposes, any commercial purposes need my permission.
- X
- XCONTACT
- X I'd really like to be in contact with anyone who wants to work on this
- X software, I *do* want to work with others, so if you have suggestions /
- X improvements / bug fixes send'em right up to me. If you post things into
- X NetNews I might not notice. My address is in the other README. Every
- X help will be acknowledged when included with future releases.
- X
- XBUGS
- X Here's some additional information for MIDI programmers about the
- X
- XMIDIclock V1.0 "MIDI Clock Generator"
- X~~~~~~~~~
- X Sometimes the MIDIclock goes into overhead, i tried to
- X react trying to flush timer requests and starting anew, but
- X somehow requests can survive and after some time hang up
- X the machine, as a warning the clock toggles the power led
- X everytime an overhead is detected, I guess the whole thing
- X should be replaced by accuracy calculations, well, they're
- X there, they just don't do what they're supposed to. One
- X more problem, the prop gadget doesn't work the way it
- X should, too! Avoid moving it while the clock is started!
- X
- X #define's
- X ~~~~~~~~
- X VBLANK: use the VBLANK unit instead of MICROHZ
- X OVERHEAD_HANDLE enable the little overhead checking routine
- X ACCURACY try to be more accurate by time calculations
- X CLOCKPRIO the task priority of the clock, or undefine it.
- X
- XFuture enhancements: (hopefully, if I can afford the time...)
- X The next thing to do is a "Human Feel" Quantizer for the MIDI Recorder,
- X this might surprise you, since such a feature is only to be found with
- X the best sequencer packages, but I currently use quite good sequencer
- X software on the C64 (!) called SuperTrack, the human quantize is the
- X feature I miss most on that program, I already wrote a "Groove" Quantizer
- X in BASIC (!), but it's a drag, so this is what I want to have next!
- X Then I will look into structure enhancements hoping to create the
- X "Lord of Sequence" that I have been fantasizing about for years, a
- X really complex MIDI Sequencer, the first to be "ShareWare" (!) I hope!
- X Btw, I wonder if anyone wrote that "Graphic MIDI Router" the programmer
- X of the midi.library was dreaming about in his "Simple MIDI Route" program.
- X
- XFINALLY...
- X This package was developed on an Amy 500 with Harddisk & 1M FastRAM.
- X I wonder if it worx under Kick 2.0...
- X
- X
- X(*lynx*)
- END_OF_FILE
- if test 3310 -ne `wc -c <'PRO_README'`; then
- echo shar: \"'PRO_README'\" unpacked with wrong size!
- fi
- chmod +x 'PRO_README'
- # end of 'PRO_README'
- fi
- if test -f 'README' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'README'\"
- else
- echo shar: Extracting \"'README'\" \(7437 characters\)
- sed "s/^X//" >'README' <<'END_OF_FILE'
- X M I D I S T U F F
- X ~ ~ ~ ~ ~ ~ ~ ~ ~
- X
- X Release 1.0 - - - MIDIstuff part I - - - Date: 16 Aug 1990
- X
- X Ok, so this is my little MIDI tool package. It's the first
- X release, it's my first Amiga release anyway. :-)
- X Introducing: This package contains 4 little tools that use the
- X MIDI.library so that they can use MIDI at the same time and can
- X easily be combined in a modular way.
- X
- XMIDIkeys V1.0 "Virtual MIDI Keyboard"
- X~~~~~~~~
- X Simulates a MIDI keyboard by painting a 10-octave (!) (full MIDI note range)
- X into a window, all incoming MIDI notes (kinda OMNI ON) are displayed by
- X highlighting the keys, the colours change depending on the velocity, when
- X the window is activated a piano keyboard is simulated on the Amiga keyboard
- X which is converted into outgoing MIDI events. Input and output streams are
- X by default sent to the MIDI interface.
- X
- X SYNOPSYS: [run] MIDIkeys [-i <Input>] [-o <Output>] [-t] [<Name>]
- X ~~~~~~~~
- X With the <i> and <o> options MIDI input & output streams can be redirected,
- X if a stream doesn't exist then the keyboard simply won't have it, e.g.
- X "MIDIkeys -i none" will cause MIDIkeys to not have any input to show.
- X The <t> enables an additional "thru" route between the input and output.
- X The <Name> is by default "Keyboard", it is the name used in the public MIDI
- X routing lists, you can use an other if you use more than one keyboard, the
- X new name will appear in the titlebar of the window.
- X
- X For other notifications the screen titlebar is used. MIDIkeys has a few
- X special keys: Right-Amiga-[`] toggles MIDI thru, also F10 does.
- X F2 and F1 respectively increment and decrement the channel the keyboard
- X sends on, which by default is 1.
- X And there also is a silly surprise key hidden somewhere...
- X
- XMIDIdump V1.0 "Simple MIDI SysX Dumper"
- X~~~~~~~~
- X Receives & Sends MIDI "System Exclusive" data, (sysx, patch data for
- X synthesizers etc.). Data can be stored and retrieved from DOS.
- X
- X SYNOPSYS: [run] MIDIdump
- X ~~~~~~~~
- X This tool always connects directly to the MIDI ports. It allocates 50000
- X bytes of buffer space for sysx data at startup. It opens a text window
- X and displays the list of commands, it uses the ARP FileRequester for
- X data storage. The program is self-explicatory (I hope!).
- X
- XMIDIrec V1.0 "Little MIDI Recorder"
- X~~~~~~~
- X Records or plays back note data from the musical instrument digital
- X interface (MIDI) using MIDI realtime information as timing clock.
- X Sequential music data can be stored and retrieved from DOS.
- X
- X SYNOPSYS: [run] MIDIrec [-i <Input>] [-o <Output>] [-t] [<Name>]
- X ~~~~~~~~
- X Arguments and options are identical to those of MIDIkeys, but, if a MIDI
- X socket doesn't exist the program complains.
- X
- X You'll be surprised when you run it, it has no "PLAY" or "STOP" keys,
- X in fact it expects START and STOP events to come from MIDI along with the
- X timing information, so the only key there needs to be is the "RECORD"
- X gadget which toggles recording and playback, when pressed it automatically
- X 'rewinds' so that recording or playback can be started immediately without
- X even stopping the clock, unless you have a drum machine or sequencer
- X attached, which would get out of sync. When activating the "RECORD" gadget
- X the buffer is automatically deleted, no "tape merging" can be done!
- X A MIDI-start-event rewinds the tape too, so the "REWIND" gadget isn't
- X usually needed. For notifications the screen titlebar is used.
- X Further functions can be obtains by picking menu items or pressing the
- X equivalent keys. The functions and keys are:
- X
- X Load (right-amiga-"l") Choose a file to load.
- X Save As (right-amiga-"s") Choose a filename to save music to.
- X Re-Read (right-amiga-"r") Load that file again.
- X Write (right-amiga-"w") Save it again.
- X Help (right-amiga-".") Give info about "tape".
- X Thru (right-amiga-"`") Toggle the thru function.
- X
- XMIDIclock V1.0 "MIDI Clock Generator"
- X~~~~~~~~~
- X Should be a reliable source of MIDI realtime clock information, but it
- X isn't. I warn you, this program generates a lot of load, too. It is better
- X to avoid using it, rather have clock events come in from the real MIDI.
- X But if you have no other choice...
- X
- X SYNOPSYS: [run] MIDIclock [-o <Output>] [<Name>]
- X ~~~~~~~~
- X Redirect the output as usual, use <Name> if you want more then one
- X (bleargh!) MIDI clock in your system! (to generate MIDI coughs etc..)
- X
- X The MIDIclock is called by the timer.device 96 times per quarter note, it
- X then outputs a clock event to its MIDI port, which can be redirected
- X into the recorder or anywhere else. It has 3 buttons, START, STOP and
- X CONTINUE, which do what they're supposed to, a proportional gadget
- X changes the speed, which by default is set to 120 b/m.
- X
- X BUGS: Amiga may halt when too much overhead is generated.
- X ~~~~
- X This happens all too easy, for example when doing lots of multi-tasking
- X like running a mouse accelerator or other load. It also can happen when
- X you use the speed gadget while the clock is running, so always stop it
- X when changing output speed, better not change it at all, it does strange
- X things sometimes! The MIDIclock has a little overhead detecting routine,
- X it will toggle the power-LED when overhead is detected. If the flashing
- X rapidly increases you better click the MIDIclock away and start a new one.
- X
- XList of files the binaries package should include:
- X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- XREADME
- XMIDIclock The executables
- XMIDIdump
- XMIDIkeys
- XMIDIrec
- XEXEC.ME A script to run a typical configuration
- X
- XLibs The libraries used by the executables
- XLibs/ARP.Library I'm not sure if they are the latest releases.
- XLibs/MIDI.Library Put them in libs: if you don't have them.
- X
- XSeQuences Data files that can be played by MIDIrec.
- XSeQuences/Bass & Tubes [Lynx'86] One channel, non-dynamic.
- XSeQuences/Castagna Groove [Lynx'89] Dynamic, multi-channel.
- XSeQuences/Hand Play [scratch] Dynamic, one channel.
- XSeQuences/Once Had A Dream [Lynx'89] Dynamic, multi-channel.
- XSeQuences/Pray Talk [Lynx'87] Non-dynamic.
- X
- XSysX Data files for the MIDIdump
- XSysX/CasioRequest.x A sysx data dump request for Casio CZ synths.
- X
- XCOPYRIGHT NOTICE
- X The binaries package is placed into public domain, this also includes the
- X music files, use them whereever you want, with one exception:
- X "Pray Talk" may not be used without my prior permission.
- X The package is provided "as is". I don't guarantee the functionality of
- X any data provided with this package.
- X
- X Source-code and binaries have originally been posted as seperated
- X packages, yet the may also appear together (in one single zoo).
- X Follow-up MIDIstuff packages may contain more efficient versions of
- X these programs, but also new MIDI modules like a MIDI-to-Amiga-Audio
- X interface, enhanced recording software like a MIDI sequencer, a
- X screen-sharing interface for all modules, etc...
- X
- XCONCLUDING...
- X Hope this helps you MIDIaners out there, enjoy music, enjoy MIDIstuff! :-)
- X Btw, none of the executables can be made resident.
- X
- XMaterial encouragements to:
- X
- X ~~~ Carl "Lynx" v. Loesch
- X $ $ Georgenstr. 142
- X v D - 8 Muenchen 40
- X \_/ ~~~~~~~~ "West" Germany...
- X
- XVirtual encouragements and suggestions to:
- X
- X loesch @ informatik.tu-muenchen.de
- X (valid till november'90 i hope)
- X lynx @ suttner.informatik.uni-oldenburg.de
- X (if the mailers manage to get through to this machine)
- X gebhart @ informatik.tu-muenchen.de
- X (if the above doesn't works; a dear friend of mine)
- END_OF_FILE
- if test 7437 -ne `wc -c <'README'`; then
- echo shar: \"'README'\" unpacked with wrong size!
- fi
- chmod +x 'README'
- # end of 'README'
- fi
- if test ! -d 'lib' ; then
- echo shar: Creating directory \"'lib'\"
- mkdir 'lib'
- fi
- if test -f 'lib/ynx.lib.uu' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'lib/ynx.lib.uu'\"
- else
- echo shar: Extracting \"'lib/ynx.lib.uu'\" \(7665 characters\)
- sed "s/^X//" >'lib/ynx.lib.uu' <<'END_OF_FILE'
- Xbegin 700 ynx.lib
- XM86H````"7U-A>4YU;0`W`E]->4]P96Y7:6YD;W<`:`)?1V5T4V-R965N`)4"1
- XM7TUA:V5087)E;G0`P0)?0S)8`.P"7TYU;51O4W1R:6YG`#L#7T=E=%=I;F1OK
- XM=P"!`U]4:&EC:U1E>'0`X@-?0VAE8VM4=6D`*01?3&]A9$9R97%#;VP`*01?*
- XM3&]A9$%S`"D$7U-A=F5&<F5Q0V]L`"D$7U-A=F5!<P`I!%],;V%D`"D$7U-A6
- XM=F4`````````````````````````````````````````````````````````;
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM`````````````````````````````````````````````````````````````
- XM``````````````````````````````!!2E-A>4YU;0``````7```````````$
- XM``8````<``D`'``WP``""```7U-A>4YU;0`'"```7TYU;51O4W1R:6YG``<(K
- XM``!?36]V90`'"```7U-E=$%096X`!P@``%]497AT``<(```N8F5G:6X`````)
- XM'TY5_^Y"IT*G2&W_[R\M``P13KKZ<0`?3^\`$!M`_^XO+0`4+RT`$!4O+0`(:
- XM3KKZ<@`=3^\`#"\M`!@O+0`(3KKZ<P`?4$\0+?_N2(!(P"\`2&W_[Q4O+0`(K
- XM3KKZ=``73^\`#$Y=3G7U````04I->4]P96Y7:0```$0````````````%``$`G
- XM'``)`!L`,<```@@``%]->4]P96Y7:6YD;W<`!P@``%]/<&5N5VEN9&]W``<(Q
- XM``!?0VEA;P`'"@``7W9I9&5O<VEG``<(```N8F5G:6X``````H``.AM.50``A
- XM+PHO+0`(3KKZ<0`96$\D0$J`9@I(>OHA8``P$4ZZ^G(`'UA/(&H`5G``$"@`N
- XM#W(!X:$1@ZW0`G,`'R`*)%].74YU3F\@=VEN9&\1=P#U`$%*1V5T4V-R964`<
- XM``!:`````````````P```!0`"0`4`"W```((``!?1V5T4V-R965N``<(``!?2
- XM3W!E;E-C<F5E;@`'"```+F)E9VEN````'TY5_^!";?_@.VT`%O_B.VT?`!K_B
- XMY#MM`![_YCMM`!+_Z!\;;0`C_^H;;0`G_^L[;0`J'__L.VT`"O_N0JW_\"MMM
- XM``P?__1"K?_X*VT`+/_\2&W_X!%.NOIQ`!583TY=3G7U`$%*36%K95!A<F4`+
- XM``!:`````````````P```!,`"0`3`"S```((``!?36%K95!A<F5N=``'"```8
- XM7W-T<FQE;@`'"```+F)E9VEN```93E7__"\M``A.NOIQ`!]83]"M``A3@"M`0
- XM__P@;?_\'['M``AG&B!M__P,$``O9Q`?(&W__`P0`#IG!E.M__Q@W!\@;?_\;
- XM#!``.F<((&W__$(0'6`((&W__$(H``%.74YU]0``04I#,E@``````````#P`.
- XM```4```````"``(`$``)``X`*\```@@``%]#,E@`!P@``"YB96=I;@`#@```E
- XM`X``$1-.50``]1\P,3(S-#4V-S@Y86)C9&5F$`#T]1)?7P#T'7``$"T`"\"\.
- XM````#T'Z^F``$QMP"`#0A"%A`#$?<``0+0`+P+P```#PZ(A!^OI@`!,;<`@`_
- XMT(1A`!%!^OIA`!4@"$Y=3G7U`````$%*3G5M5&]3='(```#4````````````'
- XM!````!4`"0`5`$_```((``!?3G5M5&]3=')I;F<`!P@``"YM;V1U``<(```N(
- XM9&EV=0`'"```+F)E9VEN`!].5?_V2.<,`'@`>@!*K0`4'V8(*WP````P`!1*K
- XMK0`(9S`7<@H@+0`(3KKZ<0`?T+P````P$@52!70`%`%![1W_]A&`*`!R"B`M[
- XM``A.NOIR`!\K0``(8,IP`!`%(BT`$+*`'V,H<``0!'(`$@4D+0`0E($?L()DP
- XM%!`$4@1R`!(`(&T`#!\1K0`7&`!@VF`62JT`$&<0'W``$`4B+0`0LH!D!%,%*
- XM8/`?2@5C'E,%<``0!4'M__82!!]2!'0`%`$B;0`,$[`(`"@`'V#><``0!"!M/
- XM``Q",`@`<``9$`1,WP`P3EU.=?4```!!2D=E=%=I;F1O````E```````````A
- XM``4``0`;``D`&@!&P``""```7T=E=%=I;F1O=P`'"```7T]P96Y7:6YD;W<`#
- XM!P@``%]#:6%O``<*``!?=FED96]S:6<`!P@``"YB96=I;@````*``(H?3E7_#
- XMT"\*.VT`#O_0.VT`$A__TCMM`!;_U#MM`!K_UAMM'P`?_]@;;0`C_]DK;0`D\
- XM_]H?("T`*("\````"BM`_]Y"K1__XBMM``C_ZD*M_^Y"K?_R&SM\``'__DAMT
- XM_]!.NOIQ`!E83R1`2H!F"DAZ^B%@`#`13KKZ<@`?6$\@:@!6<``0*``/<@'A#
- XMH1K=`"<P`?(`HD7TY=3G5.;R!W:6YD;Q%W`/4`````04I4:&EC:U1E>```+
- XM`-8````````````(````)``)`"0`8<```@@``%]4:&EC:U1E>'0`!P@``%]!`
- XM<VM3;V9T4W1Y;&4`!P@``%]39713;V9T4W1Y;&4`!P@``%]S=')L96X`!P@`G
- XM`%]3971!4&5N``<(``!?36]V90`'"```7U1E>'0`!P@``"YB96=I;@``'4Y5)
- XM``!(YPP`+RT`"$ZZ^G$`'UA/*``O!$AX``0O+0`(3KKZ<@`;3^\`#"@`+RT`X
- XM%$ZZ^G,`'UA/&@`0+0`;2(!(P"\`+RT3``A.NOIT`!]03R`M`!!2@"\`("T`6
- XM#%*`%R\`+RT`"$ZZ^G4`'T_O``P0!4B`2,`O`"\M`!05+RT`"$ZZ^G8`'T_OZ
- XM``P0+0`?2(!(P"\`+RT3``A.NOIT`!]03R\M`!`O+0`,+RT`"$ZZ^G4`'T_O>
- XM``P0!4B`2,`O`"\M`!05+RT`"$ZZ^G8`'4_O``PO!$*G+RT`"$ZZ^G(`'4_OW
- XM``PH`$S?`#!.74YU]0```$%*0VAE8VM4=6D```"`````````````"````"(`W
- XM"0`B`$?```((``!?0VAE8VM4=6D`!PH``%]W:6X`!P@``%]'971-<V<`!P@`M
- XM`%]297!L>4US9P`'"```7TAA;F1L945V96YT``<(``!?2&ET84ME>0`'"```Z
- XM7T-I86\`!P@``"YB96=I;@`93E4``$CG#B`@;=`"<0`5+R@`5DZZ^G(`'UA/"
- XM)$!*@&=<*"H`%#PJ`!@7*BH`'"\*3KKZ<P`96$\@!&`B+P5.NOIT`!M83V`XT
- XM<``P!B\`3KKZ=0`76$]@*D*G3KKZ=@`?6$]@()"\````0&?6D+P``!\`P&?.D
- XMD+P```$`9]Z0O```'0(`9\A@D$S?!'!.74YU]0``04I&:6QE<P```````IP`Z
- XM```````````:``(`6@`)`%@!*<```@@``%],;V%D1G)E<4-O;``""``27TQO,
- XM861!<P`'"@``7V9R97$`!PH``%]L;V%D;F%M90`'"```7T9I;&5297%U97-T?
- XM``<*``!?9&ER``<*``!?9FEL90`'"```7W-T<F-P>0`'"```7U1A8VM/;@`''
- XM"```7TQO861)=``""`!P7U-A=F5&<F5Q0V]L``((`()?4V%V94%S``<*``!?6
- XM<V%V96YA;64`!P@``%]3879E270``@@`X%],;V%D``<*``!?<F5T``<(``!?\
- XM4U!R:6YT9@`'"```7U-A>0`'"```7T]P96X`!P@``%]296%D``<(``!?0VQO7
- XM<V4``@@!L%]3879E``<(``!?1&5L971E1FEL90`'"```7T%R<$QO8VL`!P@`K
- XM`%]7<FET90`'"```+F)E9VEN``````*``7@"@`)F'TY5```@;0`,$7P``@`)$
- XM3ET73G5.50``(&W0`G(`%T/Z`$X@B4'Z^G,`$2)MT`)R`!DC2``$0?K_TB)MS
- XMT`)R`!4C2``2+RW0`G(`$4ZZ^G0`%UA/2H!G($AZ^G4`$4AZ^G8`$4ZZ^G<`*
- XM$U!/2'KZ<P`12'KZ=@`13KKZ>``34$].NOIY`!E.74YU3&]A9```'TY5```@%
- XM;0`,$7P``P`)3ET73G5.50``(&W0`G(`%T/Z`$X@B4'Z^GP`$2)MT`)R`!DCG
- XM2``$0?K_TB)MT`)R`!4C2``2+RW0`G(`$4ZZ^G0`%UA/2H!G($AZ^G4`$4AZW
- XM^G8`$4ZZ^G<`$U!/2'KZ?``12'KZ=@`13KKZ>``34$].NOI]`!E.74YU4V%V4
- XM90``'4Y5``!(YP@@+RT`"$AZ^B%@`#`12'KZ?P`13KKZ<`$53^\`#$AZ^G\`W
- XM$4ZZ^G$!&UA/2'@#[2\M``A.NOIR`1]03R1`2H!G%"\M`!`O+0`,$R\*3KKZ9
- XM<P$=3^\`#"@`(`IG""\*3KKZ=`$?6$]*A&<D(`12@&<>+P1(>OHA8``^$4AZG
- XM^G\`$4ZZ^G`!%4_O``Q(>OI_`!%.NOIQ`1583V`,2'KZ(6``4((13KKZ<0$?W
- XM6$]X`"`$3-\$$$Y=3G5,;Q]A9&EN9R`G)7,G+@`E;&0@'V)Y=&5S(&QO861E!
- XM9"X`*D\?;W!S*BP@8V]U;&1N)W0@;!5O860N```?3E4``$CG""!X`)7*+RT`A
- XM"!%(>OHA80`P$4AZ^G\`$4ZZ^G`!%4_O``Q(>OI_`!%.NOIQ`1=83R\M``A.F
- XMNOIV`1M83TAX__\O+0`(3KKZ=P$?4$]*@&8H2'@#[B\M``A.NOIR`1]03R1`+
- XM2H!G%"\M`!`O+0`,$R\*3KKZ>`$=3^\`#"@`(`IG""\*3KKZ=`$?6$]*A&<F9
- XM(`12@&<@+RT`$!%(>OHA80`]$4AZ^G\`$4ZZ^G`!%4_O``Q(>OI_`!%.NOIQC
- XM`1583V`*2'KZ(6$`7X$13KKZ<0$?6$],WP003EU.=5-A=FEN9Q\@)R5S)RX`X
- XM)6QD(&)Y=&5S'R!S=&]R960N`"I!<F=H*BP?(&-O=6QD;B=T('-A=F4N`/4`-
- X#`````
- X``
- Xend
- Xsize 5448
- END_OF_FILE
- if test 7665 -ne `wc -c <'lib/ynx.lib.uu'`; then
- echo shar: \"'lib/ynx.lib.uu'\" unpacked with wrong size!
- fi
- # end of 'lib/ynx.lib.uu'
- fi
- if test ! -d 'src' ; then
- echo shar: Creating directory \"'src'\"
- mkdir 'src'
- fi
- if test -f 'src/ClockPOW.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/ClockPOW.c'\"
- else
- echo shar: Extracting \"'src/ClockPOW.c'\" \(2138 characters\)
- sed "s/^X//" >'src/ClockPOW.c' <<'END_OF_FILE'
- X
- Xstruct PropInfo Gadget4SInfo = {
- X AUTOKNOB+FREEHORIZ,
- X -31007,-1,
- X 327,-1,
- X};
- X
- Xstruct Image Image1 = {
- X 49,0,
- X 6,12,
- X 0,
- X NULL,
- X 0x0000,0x0000,
- X NULL
- X};
- X
- Xstruct IntuiText IText1 = {
- X 3,0,JAM2,
- X 7,4,
- X NULL,
- X (UBYTE *)"Speed",
- X NULL
- X};
- X
- Xstruct Gadget Gadget4 = {
- X NULL,
- X 187,12,
- X 107,16,
- X GADGHBOX+GADGHIMAGE,
- X RELVERIFY,
- X PROPGADGET,
- X (APTR)&Image1,
- X NULL,
- X &IText1,
- X NULL,
- X (APTR)&Gadget4SInfo,
- X NULL,
- X NULL
- X};
- X
- XSHORT BorderVectors1[] = {
- X 0,0,
- X 53,0,
- X 53,17,
- X 0,17,
- X 0,0
- X};
- Xstruct Border Border1 = {
- X -2,-1,
- X 3,0,JAM1,
- X 5,
- X BorderVectors1,
- X NULL
- X};
- X
- Xstruct IntuiText IText4 = {
- X 2,0,JAM2,
- X 108,4,
- X NULL,
- X (UBYTE *)"Continue",
- X NULL
- X};
- X
- Xstruct IntuiText IText3 = {
- X 2,0,JAM2,
- X 60,4,
- X NULL,
- X (UBYTE *)"Stop",
- X &IText4
- X};
- X
- Xstruct IntuiText IText2 = {
- X 2,0,JAM2,
- X 4,4,
- X NULL,
- X (UBYTE *)"Start",
- X &IText3
- X};
- X
- Xstruct Gadget g_Start = {
- X &Gadget4,
- X 6,12,
- X 50,16,
- X NULL,
- X RELVERIFY,
- X BOOLGADGET,
- X (APTR)&Border1,
- X NULL,
- X &IText2,
- X NULL,
- X NULL,
- X NULL,
- X NULL
- X};
- X
- XSHORT BorderVectors2[] = {
- X 0,0,
- X 77,0,
- X 77,17,
- X 0,17,
- X 0,0
- X};
- Xstruct Border Border2 = {
- X -2,-1,
- X 3,0,JAM1,
- X 5,
- X BorderVectors2,
- X NULL
- X};
- X
- Xstruct Gadget g_Continue = {
- X &g_Start,
- X 109,12,
- X 74,16,
- X NULL,
- X RELVERIFY,
- X BOOLGADGET,
- X (APTR)&Border2,
- X NULL,
- X NULL,
- X NULL,
- X NULL,
- X NULL,
- X NULL
- X};
- X
- XSHORT BorderVectors3[] = {
- X 0,0,
- X 44,0,
- X 44,17,
- X 0,17,
- X 0,0
- X};
- Xstruct Border Border3 = {
- X -2,-1,
- X 3,0,JAM1,
- X 5,
- X BorderVectors3,
- X NULL
- X};
- X
- Xstruct Gadget g_Stop = {
- X &g_Continue,
- X 62,12,
- X 41,16,
- X NULL,
- X RELVERIFY,
- X BOOLGADGET,
- X (APTR)&Border3,
- X NULL,
- X NULL,
- X NULL,
- X NULL,
- X NULL,
- X NULL
- X};
- X
- X#define GadgetList1 g_Stop
- X
- Xstruct NewWindow NewWindowStructure1 = {
- X 189,50,
- X 300,31,
- X 0,2,
- X GADGETUP+CLOSEWINDOW,
- X WINDOWDRAG+WINDOWCLOSE,
- X &g_Stop,
- X NULL,
- X (UBYTE *)" MIDI Clock Generator ",
- X NULL,
- X NULL,
- X 5,5,
- X 640,200,
- X WBENCHSCREEN
- X};
- X
- X
- Xvoid HandleEvent(object)
- XAPTR object;
- X{
- X if (object == (APTR)&g_Stop) { Stop(object); return; }
- X if (object == (APTR)&g_Continue) { Continue(object); return; }
- X if (object == (APTR)&g_Start) { Start(object); return; }
- X if (object == (APTR)&Gadget4) { NewSpeed(object); return; }
- X}
- X#define HANDLEEVENT HandleEvent
- X
- X/* end of PowerWindows source generation */
- END_OF_FILE
- if test 2138 -ne `wc -c <'src/ClockPOW.c'`; then
- echo shar: \"'src/ClockPOW.c'\" unpacked with wrong size!
- fi
- chmod +x 'src/ClockPOW.c'
- # end of 'src/ClockPOW.c'
- fi
- if test -f 'src/MAKEFILE' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/MAKEFILE'\"
- else
- echo shar: Extracting \"'src/MAKEFILE'\" \(591 characters\)
- sed "s/^X//" >'src/MAKEFILE' <<'END_OF_FILE'
- XCFLAGS = +l -s
- XINCDIR = inc:
- XINTUI = syms:intuition
- XLIBS = -lynx -lmidi -la -lc32
- X
- X.c.oi:
- X cc $(CFLAGS) +I$(INTUI) -o $@ $*
- X
- XMIDIstuff: $(INTUI) MIDIkeys MIDIrec MIDIdump MIDIclock
- X run midirec
- X run midiclock -o Recorder
- X run midikeys -i Recorder -o Recorder
- X
- XMIDIkeys: MIDIkeys.oi
- X ln +q MIDIkeys.oi $(LIBS)
- X
- XMIDIrec: MIDIrec.oi RecPOW.oi
- X ln +q MIDIrec.oi RecPOW.oi $(LIBS)
- X
- XMIDIdump: MIDIdump.oi
- X ln +q MIDIdump.oi $(LIBS)
- X
- XMIDIclock: MIDIclock.oi ClockPOW.oi
- X ln +q MIDIclock.oi ClockPOW.oi $(LIBS)
- X
- X$(INTUI):
- X cc +l -s +H$(INTUI) -o t:itmp $(INCDIR)intuition/intuition.h
- X delete t:itmp
- END_OF_FILE
- if test 591 -ne `wc -c <'src/MAKEFILE'`; then
- echo shar: \"'src/MAKEFILE'\" unpacked with wrong size!
- fi
- chmod +x 'src/MAKEFILE'
- # end of 'src/MAKEFILE'
- fi
- if test -f 'src/MIDIclock.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/MIDIclock.c'\"
- else
- echo shar: Extracting \"'src/MIDIclock.c'\" \(4453 characters\)
- sed "s/^X//" >'src/MIDIclock.c' <<'END_OF_FILE'
- X/* C L O C K
- X#define VBLANK
- X*/
- X#define OVERHEAD_HANDLE
- X#define NO_ACCURACY
- X#define CLOCKPRIO 19L
- X
- Xextern struct Gadget Gadget4SInfo;
- Xextern struct NewWindow NewWindowStructure1;
- Xextern struct IntuiText IText1;
- X
- X#ifdef VBLANK
- X# define UNIT UNIT_VBLANK
- X#else
- X# define UNIT UNIT_MICROHZ
- X#endif
- X
- X#include "LYNX.H"
- X#include <hardware/cia.h>
- X
- X#include <MIDI/MIDI.h>
- XEXPORT struct MidiBase *MidiBase;
- XEXPORT struct MSource *source=0;
- XEXPORT struct MRoute *sroute=0;
- Xchar prgname[] = "Clock", *name = prgname;
- Xchar midiout[] = "MidiOut", *output= midiout;
- Xchar banner[] =
- X "*| MIDI Clock Generator V0.3 by Carlo \"Lynx\" von Loesch '90 |*";
- Xunion Event clockevent;
- X
- X#include <libraries/ARPbase.h>
- XEXPORT struct ArpBase *ArpBase;
- XEXPORT struct IntuitionBase *IntuitionBase;
- XEXPORT struct GfxBase *GfxBase;
- XEXPORT struct Window *win;
- XEXPORT struct RastPort *rp;
- X
- X#include <devices/timer.h>
- Xlong timersig;
- Xstruct MsgPort *timpo;
- Xstruct timerequest *tr;
- X#ifdef ACCURACY
- Xlong TimerBase;
- Xstruct timeval t1=NULL, t2=NULL;
- Xstruct timerequest *tr2;
- XULONG normic;
- X#endif
- X
- Xchar nomem[]="Don't do that, Dave";
- XFLAG on = NO, play = NO;
- XEXPORT long sigs, videosig;
- X
- Xmain(argc, argv) long argc; char *argv[]; {
- X register struct timerequest *time;
- X register ULONG t;
- X
- X ifnot (ArpBase = OpenLibrary("arp.library",ArpVersion))
- X Ciao("No ARP.Library");
- X IntuitionBase = ArpBase -> IntuiBase;
- X GfxBase = ArpBase -> GfxBase;
- X ifnot (MidiBase = ArpOpenLibrary (MIDINAME,MIDIVERSION))
- X Ciao ("No MIDI.Library");
- X
- X for (t=1; t<argc; t++) {
- X if (argv[t][0]=='-') switch (argv[t][1]) {
- X case 'o': output = argv[++t]; break;
- X default: Ciao("Bad args");
- X }
- X else name = argv[t];
- X }
- X win = MyOpenWindow(&NewWindowStructure1);
- X SetWindowTitles (win, -1L, banner);
- X rp = win -> RPort;
- X if (!(source = CreateMSource (name, NULL))) Ciao (nomem);
- X if (!(sroute = MRouteSource (source, output, NULL)))
- X Ciao ("no route out");
- X if (! (timpo = CreatePort (0L, 0L))) Ciao (nomem);
- X if (! (tr = CreateExtIO (timpo, sizeof(struct timerequest)) ))
- X Ciao (nomem);
- X if (OpenDevice (TIMERNAME, UNIT, tr, 0)) Ciao ("No Timer");
- X timersig = 1L<<timpo->SIGH; time = tr;
- X sigs = timersig | videosig;
- X clockevent.p[0] = (char) MS_CLOCK;
- X
- X#ifdef ACCURACY
- X TimerBase = (long) time->tr_node.io_Device;
- X if (! (tr2 = CreateExtIO (timpo, sizeof(struct timerequest)) ))
- X Ciao (nomem);
- X if (OpenDevice (TIMERNAME, UNIT_MICROHZ, tr2,0)) Ciao ("No Timer");
- X tr2 ->tr_node.io_Command = TR_GETSYSTIME;
- X normic =
- X#endif
- X time->tr_time.tv_micro = Speed2Mic(120);
- X time->tr_node.io_Command = TR_ADDREQUEST;
- X time->tr_time.tv_secs = 0;
- X#ifdef CLOCKPRIO
- X SetTaskPri(FindTask(NULL), CLOCKPRIO);
- X#endif
- X forever if (play) {
- X#ifdef ACCURACY
- X DoIO (time); GetTime (&t1);
- X#else
- X SendIO (time);
- X#endif
- X PutMidiMsg (source, &clockevent);
- X#ifdef ACCURACY
- X GetTime (&t2);
- X SubTime (&t2, &t1);
- X if ((time->tr_time.tv_micro = normic - t2.tv_micro) < 0)
- X TOG_LED;
- X#else
- X# ifdef OVERHEAD_HANDLE
- X if (CheckIO(time)) {
- X AbortIO(time); TOG_LED; DoIO(time);
- X } else
- X# endif
- X if (timersig != Wait(sigs)) CheckTui();
- X#endif
- X } else if (timersig != Wait(sigs)) CheckTui();
- X}
- X
- XNewSpeed () {
- X register long a;
- X static char s[3];
- X
- X a = 1 + (Gadget4SInfo.HorizPot / Gadget4SInfo.HorizBody);
- X NumToString (a, s, 3, ' ');
- X IText1.IText = s;
- X RefreshGadgets (win->FirstGadget, win, NULL);
- X tr->tr_time.tv_micro = Speed2Mic (a);
- X}
- XStop() {
- X SendMIDI (MS_STOP); play = NO;
- X}
- XStart() {
- X if (!play) {
- X SendMIDI (MS_START); play = YES;
- X }
- X}
- XContinue() {
- X if (!play) {
- X SendMIDI (MS_CONTINUE); play = YES;
- X }
- X}
- XHitaKey() {}
- X
- XSendMIDI (command) ULONG command; {
- X static union Event otherevent;
- X
- X otherevent.p[0] = (UBYTE) command;
- X PutMidiMsg (source, &otherevent);
- X}
- X
- X#ifdef ACCURACY
- XGetTime (ti)
- Xstruct timeval *ti; {
- X DoIO (tr2);
- X ti->tv_secs = tr2->tr_time.tv_secs;
- X ti->tv_micro= tr2->tr_time.tv_micro;
- X}
- X#endif
- X
- XCiao (str) char *str; {
- X if (str) {
- X INFO (str);
- X if (win) SetWindowTitles (win, str, str);
- X Delay (44L);
- X }
- X if (win) CloseWindowSafely (win);
- X if (sroute) DeleteMRoute (sroute);
- X if (source) DeleteMSource (source);
- X#ifdef ACCURACY
- X if (tr2) {
- X CloseDevice (tr);
- X DeleteExtIO (tr, sizeof(struct timerequest));
- X }
- X#endif
- X if (tr) {
- X AbortIO (tr); CloseDevice (tr);
- X DeleteExtIO (tr, sizeof(struct timerequest));
- X }
- X if (timpo) DeletePort (timpo);
- X if (ArpBase) CloseLibrary (ArpBase);
- X OFF_LED;
- X exit(str ? 4404L : 0L);
- X}
- X
- Xlong Speed2Mic (speed) ULONG speed; {
- X return (156250000/speed);
- X}
- END_OF_FILE
- if test 4453 -ne `wc -c <'src/MIDIclock.c'`; then
- echo shar: \"'src/MIDIclock.c'\" unpacked with wrong size!
- fi
- chmod +x 'src/MIDIclock.c'
- # end of 'src/MIDIclock.c'
- fi
- if test -f 'src/MIDIclock.uu' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/MIDIclock.uu'\"
- else
- echo shar: Extracting \"'src/MIDIclock.uu'\" \(1422 characters\)
- sed "s/^X//" >'src/MIDIclock.uu' <<'END_OF_FILE'
- Xbegin 700 MIDIclock.POW
- XM4&]W97)7:6YD;W=S('8R+C`@J3$Y.#<@8GD@24Y/5D%44D].24-3+"!)3D,N.
- XM("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@```#O@````D@``#^````H
- XM`0`````!``````M#;&]C:U!/5RYC```````````!````"@```D``!0`%`H``9
- XMR`````````````0`Q*\````````!```"`+T`,@$L`!\`!0`%_____P```!<@Z
- XM34E$22!#;&]C:R!'96YE<F%T;W(@```!O!@`/@`,`"D`$`````,``0`!N\0`R
- XM`````````````````````````;OP__[__P,```4``;O4````````````+```K
- XM`"P`$0```!$```````````````H````!`,5GR`#%>;@`Q7G(`,6AX```L6``@
- XM`5<(````!V=?4W1O<``````%4W1O<``````!``````$``````0`````!```!#
- XMQ>@`;0`,`$H`$`````,``0`!O$0``````````````````````````;QP__[_N
- XM_P,```4``;Q4````````````30```$T`$0```!$```````````````H````!?
- XM``&\F``!O4```;RP``'%N``!Q<@``<78````"V=?0V]N=&EN=64`````"4-O[
- XM;G1I;G5E``````$``````0`````!``````$```+&Z``&``P`,@`0`````P`!?
- XM``'&%````````<9````````````````!QMC__O__`P``!0`!QB0`````````O
- XM```U````-0`1````$0```````````@`!```$``0```````'&8``!QG`````&[
- XM4W1A<G0``@`!```\``0```````'&D``!QJ`````%4W1O<``"``$``&P`!```M
- XM`````<;```````````E#;VYT:6YU90`````*`````0`!RM```<K@``'*\``!B
- XMRS```<M```'+F`````AG7U-T87)T``````93=&%R=``````!``````$`````=
- XM`0`````!````````NP`,`&L`$`````,``P`"R@```````,68P````````LG@>
- XM``4`Q:%P__[__P,```4``L<D````````````;@```&X`$0```!$``````#$`Z
- XM```&``P``````````````````````P`!```'``0``````,682``````````&,
- XM4W!E960``0.&X?__`4?__P````@``P`!`,2M.`#%E````580`,?B$`#%E!@`_
- XIQ^(@`````0`````)3F5W4W!E960``````0`````!``````$``````0#%W
- X``
- Xend
- Xsize 986
- END_OF_FILE
- if test 1422 -ne `wc -c <'src/MIDIclock.uu'`; then
- echo shar: \"'src/MIDIclock.uu'\" unpacked with wrong size!
- fi
- # end of 'src/MIDIclock.uu'
- fi
- if test -f 'src/MIDIdump.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/MIDIdump.c'\"
- else
- echo shar: Extracting \"'src/MIDIdump.c'\" \(5131 characters\)
- sed "s/^X//" >'src/MIDIdump.c' <<'END_OF_FILE'
- X/* MIDI-System-Exclusive Dumper
- X Written, arranged, produced by Carl Ch. v. Loesch.
- X
- X V1.0alpha Saturday 19. 8. 89
- XChanges: V1.0beta Saturday 9. 6. 90
- X V1.0gamma Tuesday 25. 7. 90 now uses midi.library!
- X V1.0 Wednesday 15.8. 90 now uses arp.lib too
- X*/
- X#include "Lynx.h"
- X#define XBUFSIZE 50000L
- X
- X#include <libraries/ARPbase.h>
- XEXPORT struct ArpBase *ArpBase;
- XEXPORT struct IntuitionBase *IntuitionBase;
- XEXPORT char file[FCHARS+DSIZE+1]="", dir[DSIZE+1]="SysX",
- X loadname[FCHARS+1]="out.x", savename[FCHARS+1]="in.x";
- XEXPORT struct FileRequester *freq;
- XEXPORT struct Window *win;
- X
- X#include <MIDI/MIDI.h>
- XEXPORT struct MidiBase *MidiBase;
- XEXPORT struct MSource *source=0;
- XEXPORT struct MDest *dest=0;
- XEXPORT struct MRoute *droute=0, *sroute=0;
- XEXPORT struct MidiPacket *packet=0;
- Xstatic struct MRouteInfo routeinfo = { MMF_SYSEX };
- X /* receive only sys/ex msg's */
- X
- Xstruct NewWindow nw = {
- X 10, 24, 620, 117,
- X 3, 2, CLOSEWINDOW+RAWKEY, WINDOWCLOSE+WINDOWDEPTH+WINDOWDRAG
- X +SMART_REFRESH+WINDOWSIZING+NOCAREREFRESH,
- X NULL, NULL, "*| MIDI SysX Dumper V1.0 by Carlo von Loesch '89/90 |*",
- X NULL, NULL,
- X 300, 11, 640, 500,
- X WBENCHSCREEN
- X};
- X
- XEXPORT char name[]="MIDIdump";
- XEXPORT char nomem[] = "Out of RAM";
- XEXPORT UBYTE *xbuffer, ret[77];
- XEXPORT FLAG timer = NO, cons = NO, logon = YES, spool = NO;
- XEXPORT long xlen = 0, sigs, videosig, midisig;
- Xstruct IOStdReq conreq;
- X
- X_main () {
- X ifnot (ArpBase = OpenLibrary("arp.library",ArpVersion))
- X Ciao("No ARP.Library");
- X IntuitionBase = ArpBase -> IntuiBase;
- X ifnot (MidiBase = ArpOpenLibrary (MIDINAME,MIDIVERSION))
- X Ciao ("No MIDI.Library");
- X
- X conreq.io_Data = win = MyOpenWindow (&nw);
- X OpenDevice("console.device", NULL, &conreq, NULL); cons=YES;
- X ifnot (xbuffer = ArpAlloc (XBUFSIZE)) Ciao (nomem);
- X
- X ifnot (freq = ArpAllocFreq()) Ciao (nomem);
- X freq->fr_Dir = dir; freq->fr_Window = win;
- X freq -> fr_FuncFlags = FRF_NewWindFunc;
- X
- X ifnot (source = CreateMSource (name, NULL)) Ciao (nomem);
- X ifnot (sroute = MRouteSource (source, "MidiOut", NULL))
- X Ciao ("No route out");
- X ifnot (dest = CreateMDest (name, NULL)) Ciao (nomem);
- X ifnot (droute = MRouteDest ("MidiIn", dest, &routeinfo))
- X Ciao ("No route in");
- X midisig = 1L<<dest->DestPort->SIGH;
- X sigs = midisig | videosig;
- X
- X HelpX ();
- X while (logon) {
- X if (midisig == Wait (sigs)) HandleMIDI();
- X else CheckTui ();
- X }
- X Ciao (NULL);
- X}
- X
- XHandleMIDI () {
- X register long i;
- X
- X if (packet = GetMidiPacket (dest)) {
- X xlen = packet->Length;
- X if (xlen < XBUFSIZE)
- X for (i=0; i<xlen; i++) xbuffer[i]=packet->MidiMsg[i];
- X else {
- X SPrintf (ret, "Buffer too small for %ld bytes.", xlen);
- X Say (ret);
- X xlen = 0;
- X }
- X FreeMidiPacket (packet);
- X SPrintf (ret, "%ld bytes received.", xlen);
- X Say (ret);
- X }
- X}
- X
- XHitaKey (raw)
- XULONG raw; {
- X static FLAG ctrl = NO;
- X register UBYTE z;
- X
- X z = raw & 0x7f;
- X if (z == 99) {
- X if (raw & 0x80) ctrl=NO;
- X else ctrl=YES;
- X return;
- X }
- X if (ctrl) switch (raw) {
- X case 16:/* Q */ logon = NO;
- X } else if (z == raw) {
- X switch (raw) {
- X case 20:/* T */ Transmit(); break;
- X case 51:/* C */ CheckX(); break;
- X case 40:/* L */ LoadAs(); break;
- X case 33:/* S */ SaveAs(); break;
- X case 69:/*ESC*/ logon = NO;
- X case 68:/*RET*/ HelpX ();
- X }
- X spool = NO;
- X }
- X}
- X
- XLoadIt() { xlen = Load (file, xbuffer,(long) XBUFSIZE); }
- XSaveIt() { if (xlen) Save (file, xbuffer,(long) xlen); }
- XLogOut() { logon = NO; }
- XHandleEvent() {} /* no gadgets */
- XTransmit () {
- X if (xlen) SendMIDI ("sysx buffer", xbuffer, xlen);
- X else Say ("*yawn*");
- X}
- X
- Xlong SendMIDI (inf, buf, len)
- X char *inf;
- X UBYTE *buf;
- X long len; {
- X register long r;
- X
- X if (inf) {
- X SPrintf (ret, "Sending %s: %ld bytes.", inf, len);
- X Say (ret);
- X }
- X PutMidiMsg (source, xbuffer);
- X if (inf) Say ("sent.");
- X}
- X
- X#define ZOTARK 15
- XCheckX () {
- X register UBYTE n;
- X register long i, j;
- X UBYTE line[16];
- X
- X if (xlen) {
- X spool = YES;
- X Say ("dump buffer:");
- X for (i=0; i<xlen; i++) {
- X n = xbuffer[i];
- X SPrintf (ret, " %s", C2X(n)); SayMore (ret);
- X j = i & ZOTARK;
- X if (n<32 || (n>127 && n<160)) n = '.';
- X line[j] = n;
- X if (j==ZOTARK) {
- X SPrintf (ret, " \xab %s \xbb",line);
- X Say (ret); CheckTui(); if (!spool) break;
- X }
- X }
- X Say (".");
- X }
- X else Say ("*yawn*");
- X}
- X
- XHelpX () {
- X Say (" [L]oad into buffer.");
- X Say (" [T]ransmit to MIDI.");
- X Say (" [S]ave to disk.");
- X Say (" [C]heck buffer contents.");
- X Say ("\n [ESC]ape from here!");
- X Say (" [RET] type this info again.");
- X Say ("\nWhatever system-exclusive data arrives");
- X Say ("will be stored into buffer rightaway.");
- X SPrintf (ret, "\nBuffer currently contains %ld bytes.", xlen);
- X Say (ret);
- X}
- X
- XSay (text) char *text; {
- X char tmp[78];
- X SPrintf (tmp, "%s\n", text); SayMore (tmp);
- X}
- XSayMore (text) char *text; {
- X conreq.io_Data = (APTR) text;
- X conreq.io_Length = -1;
- X conreq.io_Command = CMD_WRITE;
- X DoIO(&conreq);
- X}
- X
- XCiao (str) char *str; {
- X if (cons) {
- X if (str) {
- X Say (str); Delay(21L);
- X }
- X CloseDevice (&conreq);
- X }
- X if (win) CloseWindowSafely (win);
- X if (droute) DeleteMRoute (droute);
- X if (sroute) DeleteMRoute (sroute);
- X if (dest) DeleteMDest (dest);
- X if (source) DeleteMSource (source);
- X if (ArpBase) CloseLibrary (ArpBase);
- X exit (str ? 4404L : 0L);
- X}
- END_OF_FILE
- if test 5131 -ne `wc -c <'src/MIDIdump.c'`; then
- echo shar: \"'src/MIDIdump.c'\" unpacked with wrong size!
- fi
- chmod +x 'src/MIDIdump.c'
- # end of 'src/MIDIdump.c'
- fi
- if test -f 'src/MIDIkeys.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/MIDIkeys.c'\"
- else
- echo shar: Extracting \"'src/MIDIkeys.c'\" \(6472 characters\)
- sed "s/^X//" >'src/MIDIkeys.c' <<'END_OF_FILE'
- X/* Virtual MIDI Keyboard
- X Written, arranged, produced by Carl Ch. v. Loesch.
- X (c) 1989, 1990.
- X*/
- X#include "Lynx.h"
- X
- X#include <libraries/ARPbase.h>
- Xstruct ArpBase *ArpBase;
- Xstruct IntuitionBase *IntuitionBase;
- Xstruct GfxBase *GfxBase;
- Xstruct Window *win;
- Xstruct RastPort *rp;
- X
- X#include <MIDI/MIDI.h>
- Xstruct MidiBase *MidiBase;
- Xstruct MSource *source=0;
- Xstruct MDest *dest=0;
- Xstruct MRoute *droute=0, *sroute=0, *troute;
- Xstruct MRouteInfo routeinfo = { MMF_NOTEOFF | MMF_NOTEON, 0xffff };
- X
- Xstatic UBYTE keytable[128] = {
- X 0,61,63,0,66,68,70,0,73,75,0,78,80,82,0,0, /* 0..15 */
- X 62,64,65,67,69,71,72,74,76,77,79,81,0,0,0,0, /* 16..31 */
- X 42,44,46,0,49,51,0,54,56,58,0,0,0,0,0,0, /* 32..47 */
- X 41,43,45,47,48,50,52,53,55,57,59,0,0,0,0,0, /* 48..63 */
- X 0,0,60,0,83,0,0,0,0,0,0,0,0,0,0,0, /* 64..79 (tab,cr) */
- X 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 80..95 */
- X 0,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 96..111 (rsh) */
- X 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 112..127 */
- X };
- X
- X#define JOKES 6
- Xstatic char jokes[JOKES][70] = {
- X" INCORRECT PASSWORD. TRY AGAIN. ",
- X" The password to go eat at the mensa is 'MAHLZEIT' ",
- X" How many cans can a can can if a can can can cans? ",
- X" The Lynx says: The best is yet to come... to come... to come... ",
- X" The Lord of Sequence. The ultimate Amiga MIDI sequencer program. ",
- X"Greet'ns to SNEAK, NOAK, KIR, MADGUIT, KBR, YETI, ANT, WIZ, CRACKAKAN.",
- X};
- X
- Xstruct NewWindow nw = {
- X 0, 11, 640, 40,
- X 1, 2, CLOSEWINDOW+RAWKEY,
- X WINDOWCLOSE+WINDOWDEPTH+WINDOWDRAG+SMART_REFRESH,
- X NULL, NULL, NULL, NULL, NULL,
- X 0, 0, 0, 0,
- X WBENCHSCREEN
- X};
- X
- Xchar keyboard[] = "Keyboard", *name = keyboard;
- Xchar midiin[] = "MidiIn", *input = midiin;
- Xchar midiout[] = "MidiOut", *output= midiout;
- Xchar nomem[] = "Gimme RAM!";
- Xchar banner[] =
- X "*| Virtual MIDI Keyboard V1.0 by Carlo \"Lynx\" von Loesch (c)89 |*";
- Xchar header[] = "*| Virtual MIDI Keyboard ", *title = header;
- XFLAG logon = TRUE, thru = FALSE;
- XEXPORT long videosig, sigs;
- X
- Xmain(argc, argv) long argc; char *argv[]; {
- X register struct IntuiMessage *tuimsg;
- X register union Event *e;
- X register long t;
- X register short s;
- X
- X ifnot (ArpBase = OpenLibrary("arp.library",ArpVersion))
- X Ciao("No ARP.Library");
- X IntuitionBase = ArpBase -> IntuiBase;
- X GfxBase = ArpBase -> GfxBase;
- X ifnot (MidiBase = ArpOpenLibrary (MIDINAME,MIDIVERSION))
- X Ciao ("No MIDI.Library");
- X
- X for (t=1; t<argc; t++) {
- X if (argv[t][0]=='-') select (argv[t][1]) {
- Xwhen 'i': input = argv[++t]; break;
- Xwhen 'o': output = argv[++t]; break;
- Xwhen 't': Thru(); break;
- Xotherwise Ciao("Bad args");
- X }
- X else title = name = argv[t];
- X }
- X win = MyOpenWindow (&nw);
- X SetWindowTitles (win, title, banner);
- X rp = win->RPort;
- X for (t=0; t<10; t++) DrawOctave (rp, t);
- X
- X ifnot (source = CreateMSource (name, NULL)) Ciao (nomem);
- X ifnot (dest = CreateMDest (name, NULL)) Ciao (nomem);
- X sroute = MRouteSource (source, output, NULL);
- X droute = MRouteDest (input, dest, &routeinfo);
- X
- X sigs = videosig | (1L << dest->DestPort->SIGH);
- X while (logon) {
- X if (videosig != Wait (sigs))
- X while (e = GetMidiMsg (dest)) {
- X Show (e->l);
- X FreeMidiMsg (e);
- X }
- X else while (tuimsg = GetMsg (win->UserPort)) {
- X t=tuimsg->Class; s=tuimsg->Code; ReplyMsg (tuimsg);
- X select (t) {
- Xwhen RAWKEY: HitaKey(s); break;
- Xwhen CLOSEWINDOW: logon = FALSE;
- X }
- X }
- X }
- X Ciao ("Please close the window, it's cold outside. *grin* :-)");
- X}
- X
- XHitaKey (raw)
- Xshort raw; {
- X static union Event e;
- X static char chan;
- X static FLAG amiga = FALSE;
- X#ifdef CTRL
- X static FLAG ctrl = FALSE;
- X#endif
- X register UBYTE z;
- X
- X z = (UBYTE) (raw & 0x7f);
- X if (z == 103) {
- X if (raw & 0x80) amiga=FALSE;
- X else amiga=TRUE;
- X return;
- X }
- X#ifdef CTRL
- X if (z == 99) {
- X if (raw & 0x80) ctrl=FALSE;
- X else ctrl=TRUE;
- X return;
- X }
- X if (ctrl) select (raw) {
- Xwhen 51:/* C */ logon = FALSE;
- X }
- X else
- X#endif
- X if (amiga) select (raw) {
- Xwhen 0: /* ` */ Thru();
- X }
- X else if (e.p[1] = keytable[z]) {
- X e.p[0] = MS_NOTEON + chan;
- X if (raw & 0x80) e.p[2] = 0;
- X else e.p[2] = 64;
- X/* I think 64 is the standard velocity value for non-dynamic keyboards */
- X PutMidiMsg (source, &e);
- X Show (e);
- X }
- X else select (raw) {
- Xwhen 89:/*F10*/ Thru(); break;
- Xwhen 43:/* # */ Jokerman(); break;
- Xwhen 81:/*F2*/ chan+=2; if (chan>16) chan=1;
- Xwhen 80:/*F1*/ if (--chan<0) chan=15;
- X title[0] = chan+49; Say (title);
- X }
- X}
- X
- XThru() {
- X register UBYTE *ret;
- X
- X if (thru = !thru)
- X if (troute = MRoutePublic (input, output, routeinfo))
- X ret = "Route has been established.";
- X else { thru = NO; ret = "No route could be established."; }
- X else { DeleteMRoute (troute); ret = "Route deleted."; }
- X Say (ret);
- X}
- X
- X#define COLORS 4
- X#define DEPTH 2
- X#define TOP 11
- X#define BOT 37
- X#define MID 26
- X#define LEFMARG 5
- X
- XShow (e)
- X union Event e; {
- X register long z, o;
- X static char offs[12] =
- X { 1, 6, 11, 16, 22, 27, 32, 37, 42, 47, 52, 58 };
- X static char white[12] =
- X { 1, 0, 10, 0, 19, 28, 0, 37, 0, 46, 0, 55 };
- X
- X z = e.p[2]; /* velocity */
- X if (!z || e.p[0] == MS_NOTEOFF) SetAPen (rp, 0L);
- X else SetAPen (rp, z / (128/(COLORS-1)) + 1 );
- X if (z == 7) Jokerman();
- X
- X z = e.p[1] % 12; o = 63 * (e.p[1]-z)/12 + LEFMARG;
- X if (white[z]) RectFill (rp, o+white[z], MID+1, o+white[z]+7, BOT-1);
- X z = o + offs[z] + 1;
- X RectFill (rp, z, TOP+1, z+3, MID-1);
- X}
- X
- XDrawOctave (raz, x)
- X int raz, x; {
- X x = 63*x + LEFMARG;
- X Move (raz, x, TOP); /* box around it */
- X Draw (raz, x+63, TOP); Draw (raz, x+63, BOT);
- X Draw (raz, x, BOT); Draw (raz, x, TOP);
- X
- X x+=9; Move (raz, x, BOT); DrawKey (raz, x, 3);
- X x+=9; Move (raz, x, BOT); DrawKey (raz, x, 2);
- X x+=9; Move (raz, x, BOT); Draw (raz, x, TOP);
- X x+=9; Move (raz, x, BOT); DrawKey (raz, x, 4);
- X x+=9; Move (raz, x, BOT); DrawKey (raz, x, 3);
- X x+=9; Move (raz, x, BOT); DrawKey (raz, x, 2);
- X}
- X
- XDrawKey (raz, x, i)
- X int raz, x, i; {
- X Draw (raz, x, MID);
- X Draw (raz, x-i, MID);
- X Draw (raz, x-i, TOP);
- X Move (raz, x, MID);
- X Draw (raz, x-i+5, MID);
- X Draw (raz, x-i+5, TOP);
- X}
- X
- XJokerman() {
- X static UBYTE joker = 0;
- X SetWindowTitles (win, jokes[joker++], banner);
- X if (joker==JOKES) joker = 0;
- X}
- X
- XSay (str) char *str; { if (win) SetWindowTitles (win, -1L, str); }
- X
- XCiao (str)
- X char *str; {
- X if (str) { Say (str); Delay (25L); }
- X if (win) CloseWindowSafely (win);
- X if (droute) DeleteMRoute (droute);
- X if (sroute) DeleteMRoute (sroute);
- X if (thru) DeleteMRoute (troute);
- X if (dest) DeleteMDest (dest);
- X if (source) DeleteMSource (source);
- X if (ArpBase) CloseLibrary (ArpBase);
- X exit (NULL);
- X}
- END_OF_FILE
- if test 6472 -ne `wc -c <'src/MIDIkeys.c'`; then
- echo shar: \"'src/MIDIkeys.c'\" unpacked with wrong size!
- fi
- chmod +x 'src/MIDIkeys.c'
- # end of 'src/MIDIkeys.c'
- fi
- if test -f 'src/MIDIrec.POW.uu' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/MIDIrec.POW.uu'\"
- else
- echo shar: Extracting \"'src/MIDIrec.POW.uu'\" \(1708 characters\)
- sed "s/^X//" >'src/MIDIrec.POW.uu' <<'END_OF_FILE'
- Xbegin 700 MIDIrec.POW
- XM4&]W97)7:6YD;W=S('8R+C`@J3$Y.#<@8GD@24Y/5D%44D].24-3+"!)3D,N.
- XM("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@```#O@````D@``#^````H
- XM`0`````!``````E296-03U<N8P```````````0``$`H```-```4`!0*``,@`>
- XMPP#P```````"`,!I@````````0```@'E`#(`FP`?``4`!?____\````0($U)_
- XM1$D@4F5C;W)D97(@``##B3@`40`,`$0`$````0,``0##B0P``````,!NF```;
- XM``````````(`PAI`__[__P,```4`PXD<````````````1P```$<`$0```!$`Y
- XM``````````(``0``"``$``````#`;T``````````!U)E8V]R9``````*```!O
- XM`0#`;U``P'&X`,!QR`#`<U@`P'-H`,!T6`````EG7U)E8V]R9``````'4F5CC
- XM;W)D``````$``````0`````!``````$````````'``P`1``0`````P`!`,.)`
- XM9```````PBEP````````````!`#"+U#__O__`P``!0##B70```````````!'.
- XM````1P`1````$0```````````@`!```)``0``````,!T@``````````'4F5WB
- XM:6YD``````H````!`,($``#!&Q@`P>%(`,(96`#"&9@`PD*P````"6=?4F5W!
- XM:6YD``````=297=I;F0``````0`````!``````$``````0``PP"0`0``````#
- XM`$L```##`7``PV#P````"%!R;VIE8W0``,,!$`##`I``;`##!R``````$````
- XMPPB@``````("`P$```````````!H``@```````````````5,;V%D``````$`I
- XM`,,"H`##!T@0<@##"3``````$```PPOP``````("`P$`````````"0!H``@`$
- XM``````````````A292UR96%D``````$``,,)6`##!X`0<P##-M@`````$```;
- XMPP[8``````("`P$`````````$@!H``@```````````````E3879E(&%S(```?
- XM```!``###!``PS<8$'<`PT)``````!```,,^8``````"`@,!`````````!L`2
- XM:``(```````````````&5W)I=&4``````0``PS<H`,,W@````,-,:`##3X@0_
- XM`````````````@(#`0`````````D`&@`"```````````````!5%U:70`````$
- XM`0``PTR0`,-":````,-1V```````````!@(#`0``````(0`#`'@`"```````I
- XM````````$"!A<F4@>6]U('-U<F4_(``````!``##3Z@!``!2````.0```,.)V
- XMD``````````&5&]O;',``,-2``##81`0+@##B;``````$```PXG8``````("B
- XM`P$```````````"```@```````````````5(96QP``````$``,.*(`##BC@0=
- XM8`##B?@`````$`````````````("`P$`````````"0"```@`````````````-
- X3``Q4;V=G;&4@5&AR=0`````!``("V
- X``
- Xend
- Xsize 1189
- END_OF_FILE
- if test 1708 -ne `wc -c <'src/MIDIrec.POW.uu'`; then
- echo shar: \"'src/MIDIrec.POW.uu'\" unpacked with wrong size!
- fi
- # end of 'src/MIDIrec.POW.uu'
- fi
- if test -f 'src/MIDIrec.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/MIDIrec.c'\"
- else
- echo shar: Extracting \"'src/MIDIrec.c'\" \(5581 characters\)
- sed "s/^X//" >'src/MIDIrec.c' <<'END_OF_FILE'
- X/* M I D I R E C
- X
- X Little MIDI Recorder
- X Written, arranged, produced by Carl Ch. v. Loesch.
- X
- X V0.1 February'89, V0.2 August'89, V0.3 July'90
- X V1.0 August'90.
- X#define DEBUG
- X*/
- X#include "Lynx.h"
- Xextern struct Menu Menu1;
- Xextern struct NewWindow NewWindowStructure1;
- XEXPORT char ret[80];
- X
- X#include <MIDI/MIDI.h>
- XEXPORT struct MidiBase *MidiBase;
- XEXPORT struct MSource *source=0;
- XEXPORT struct MDest *dest=0;
- XEXPORT struct MRoute *droute=0, *sroute=0, *troute;
- Xstatic struct MRouteInfo routeinfo = { MMF_CHAN + MMF_SYSRT, 0xffff };
- X
- XEXPORT char prgname[] = "Recorder", *name = prgname;
- XEXPORT char midiin[] = "MidiIn", *input = midiin;
- XEXPORT char midiout[] = "MidiOut", *output= midiout;
- X
- X#include <libraries/ARPbase.h>
- XEXPORT struct ArpBase *ArpBase;
- XEXPORT struct IntuitionBase *IntuitionBase;
- XEXPORT char file[FCHARS+DSIZE+1]="", dir[DSIZE+1]="Sequences",
- X loadname[FCHARS+1]="Hello", savename[FCHARS+1]="Hello";
- XEXPORT struct FileRequester *freq;
- XEXPORT struct Window *win;
- X
- X#define TAPELEN 15000
- XEXPORT struct Tape {
- X union Event event;
- X short clock;
- X} *tape;
- X
- X#define RECORDERPRIO 3L
- XEXPORT char banner[] =
- X "*| Little MIDI Recorder V1.0 by Carlo \"Lynx\" von Loesch (c)90 |*";
- XEXPORT char *title = banner;
- XEXPORT char nomem[] = "Out of RAM";
- XEXPORT ULONG tc = 0, tl = 0, ck = 0, nextck, lastck;
- XEXPORT FLAG on = YES, thru = NO, play = NO, rec = NO;
- XEXPORT long midisig, videosig, sigs;
- X
- Xmain(argc, argv) long argc; char *argv[]; {
- X register long t;
- X register short s;
- X register union Event *e;
- X
- X ifnot (ArpBase = OpenLibrary("arp.library",ArpVersion))
- X Ciao("No ARP.Library");
- X IntuitionBase = ArpBase -> IntuiBase;
- X ifnot (MidiBase = ArpOpenLibrary (MIDINAME,MIDIVERSION))
- X Ciao ("No MIDI.Library");
- X ifnot (tape = ArpAlloc (TAPELEN * sizeof(struct Tape)))
- X Ciao (nomem);
- X
- X for (t=1; t<argc; t++) {
- X if (argv[t][0]=='-') select (argv[t][1]) {
- X when 'i': input = argv[++t]; break;
- X when 'o': output = argv[++t]; break;
- X when 't': Thru(); break;
- X otherwise Ciao("Bad args");
- X }
- X else title = name = argv[t];
- X }
- X ifnot (source = CreateMSource (name, NULL)) Ciao (nomem);
- X ifnot (sroute = MRouteSource (source, output, NULL))
- X Ciao ("No route out");
- X ifnot (dest = CreateMDest (name, NULL)) Ciao (nomem);
- X ifnot (droute = MRouteDest (input, dest, &routeinfo))
- X Ciao ("No route in");
- X midisig = 1L<<dest->DestPort->SIGH;
- X
- X win = MyOpenWindow(&NewWindowStructure1); Say (banner);
- X SetMenuStrip (win, &Menu1);
- X sigs = videosig | midisig;
- X
- X ifnot (freq = ArpAllocFreq()) Ciao (nomem);
- X freq->fr_Dir = dir; freq->fr_Window = win;
- X freq -> fr_FuncFlags = FRF_NewWindFunc;
- X
- X#ifdef RECORDERPRIO
- X SetTaskPri(FindTask((char *) 0L), RECORDERPRIO);
- X#endif
- X while (on) {
- X t = Wait (sigs);
- X if (t == midisig) while (e = GetMidiMsg (dest)) {
- X HandleMIDI (e->l); FreeMidiMsg (e);
- X } else MyCheckTui();
- X }
- X Ciao (NULL);
- X}
- X
- XHandleMIDI (e) union Event e; {
- X if (e.p[0] > 0xf0) select (e.p[0]) {
- Xwhen MS_CLOCK: if (play) PlayIt(); break;
- Xwhen MS_START: Rewind();
- Xwhen MS_CONTINUE: play=YES; LBUG ("PLAY at clk", ck); break;
- Xwhen MS_STOP: play=NO; LBUG ("STOP at clk", ck); break;
- Xotherwise XBUG ("Weird Event", e.l);
- X }
- X else if (rec && play && tl < TAPELEN) {
- X#ifdef TOUCHSTART
- X if (!tl) ck=1;
- X /* start counting from first input, ignoring sync */
- X#endif
- X tape[tl].clock = ck - lastck;
- X tape[tl++].event = e;
- X lastck = ck;
- X }
- X}
- X
- XPlayIt() {
- X if (!rec && (ck == nextck)) {
- X PutMidiMsg (source, &tape[tc++].event);
- X while (tape[tc].clock == 0)
- X PutMidiMsg (source, &tape[tc++].event);
- X if (tc < tl) nextck = ck + tape[tc].clock;
- X else nextck = 0;
- X }
- X ck++;
- X}
- X
- XThru() {
- X if (thru = !thru)
- X if (troute = MRoutePublic (input, output, routeinfo))
- X SPrintf (ret,
- X"Route between %s and %s has been established.", input, output);
- X else { thru = NO; SPrintf (ret,
- X"No route between %s and %s could be established.", input, output);
- X }
- X else {
- X DeleteMRoute (troute);
- X SPrintf (ret, "Ok. No more route between %s and %s.",
- X input, output);
- X }
- X Say (ret);
- X}
- X
- XRecord() {
- X rec=!rec;
- X FBUG ("RECORD", rec);
- X Rewind();
- X}
- XRewind() {
- X tc=0; ck=1; nextck=(ULONG) tape[0].clock; lastck=1;
- X if (rec) tl=0;
- X LBUG ("REWIND with tl", tl);
- X}
- XSaveIt() {
- X if (tl) Save (file, &tape[0],(long) tl*sizeof(struct Tape));
- X}
- XLoadIt() {
- X play=NO; Rewind();
- X tl = Load (file, &tape[0],(long) TAPELEN*sizeof(struct Tape))
- X / sizeof(struct Tape);
- X}
- XHelp() {
- X SPrintf (ret, "Clock: %ld, Counter: %ld, SeqLength: %ld.",
- X ck, tc, tl); Say (ret);
- X}
- X
- XMyCheckTui() {
- X register struct IntuiMessage *tuimsg;
- X register ULONG class, obj;
- X register USHORT code;
- X
- X while (tuimsg = GetMsg (win->UserPort)) {
- X class = tuimsg->Class;
- X code = tuimsg->Code;
- X obj= tuimsg->IAddress; ReplyMsg (tuimsg);
- X switch (class) {
- Xcase MENUPICK: DoMenu(code); break;
- Xcase GADGETUP: HandleEvent (obj); break;
- Xcase CLOSEWINDOW: Ciao (NULL);
- X }
- X }
- X}
- X
- XDoMenu (code) USHORT code; {
- X NBUG (" MenuCode", code);
- X select (MENUNUM(code)) {
- Xwhen 0: select (ITEMNUM(code)) {
- X when 0: LoadAs(); break;
- X when 1: LoadIt(); break;
- X when 2: SaveAs(); break;
- X when 3: SaveIt(); break;
- X when 4: Ciao(NULL);
- X } break;
- Xwhen 1: select (ITEMNUM(code)) {
- X when 0: Help(); break;
- X when 1: Thru();
- X }
- X }
- X}
- X
- XSay (str) char *str; { if (win) SetWindowTitles (win, -1L, str); }
- X
- XCiao (str) char *str; {
- X if (win) CloseWindowSafely (win);
- X if (droute) DeleteMRoute (droute);
- X if (sroute) DeleteMRoute (sroute);
- X if (thru) DeleteMRoute (troute);
- X if (dest) DeleteMDest (dest);
- X if (source) DeleteMSource (source);
- X if (ArpBase) {
- X if (str) Puts(str);
- X CloseLibrary (ArpBase);
- X }
- X exit (str ? 4404L : 0L);
- X}
- END_OF_FILE
- if test 5581 -ne `wc -c <'src/MIDIrec.c'`; then
- echo shar: \"'src/MIDIrec.c'\" unpacked with wrong size!
- fi
- chmod +x 'src/MIDIrec.c'
- # end of 'src/MIDIrec.c'
- fi
- if test -f 'src/RecPOW.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/RecPOW.c'\"
- else
- echo shar: Extracting \"'src/RecPOW.c'\" \(3339 characters\)
- sed "s/^X//" >'src/RecPOW.c' <<'END_OF_FILE'
- X
- XSHORT BorderVectors1[] = {
- X 0,0,
- X 71,0,
- X 71,17,
- X 0,17,
- X 0,0
- X};
- Xstruct Border Border1 = {
- X -2,-1,
- X 3,0,JAM1,
- X 5,
- X BorderVectors1,
- X NULL
- X};
- X
- Xstruct IntuiText IText1 = {
- X 2,0,JAM2,
- X 9,4,
- X NULL,
- X (UBYTE *)"Rewind",
- X NULL
- X};
- X
- Xstruct Gadget g_Rewind = {
- X NULL,
- X 7,12,
- X 68,16,
- X NULL,
- X RELVERIFY,
- X BOOLGADGET,
- X (APTR)&Border1,
- X NULL,
- X &IText1,
- X NULL,
- X NULL,
- X NULL,
- X NULL
- X};
- X
- XSHORT BorderVectors2[] = {
- X 0,0,
- X 71,0,
- X 71,17,
- X 0,17,
- X 0,0
- X};
- Xstruct Border Border2 = {
- X -2,-1,
- X 3,0,JAM1,
- X 5,
- X BorderVectors2,
- X NULL
- X};
- X
- Xstruct IntuiText IText2 = {
- X 2,0,JAM2,
- X 8,4,
- X NULL,
- X (UBYTE *)"Record",
- X NULL
- X};
- X
- Xstruct Gadget g_Record = {
- X &g_Rewind,
- X 81,12,
- X 68,16,
- X NULL,
- X RELVERIFY+TOGGLESELECT,
- X BOOLGADGET,
- X (APTR)&Border2,
- X NULL,
- X &IText2,
- X NULL,
- X NULL,
- X NULL,
- X NULL
- X};
- X
- X#define GadgetList1 g_Record
- X
- Xstruct IntuiText IText3 = {
- X 3,1,COMPLEMENT,
- X 0,0,
- X NULL,
- X (UBYTE *)"Toggle Thru",
- X NULL
- X};
- X
- Xstruct MenuItem MenuItem2 = {
- X NULL,
- X 0,9,
- X 128,8,
- X ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHBOX,
- X 0,
- X (APTR)&IText3,
- X NULL,
- X '`',
- X NULL,
- X MENUNULL
- X};
- X
- Xstruct IntuiText IText4 = {
- X 3,1,COMPLEMENT,
- X 0,0,
- X NULL,
- X (UBYTE *)"Help",
- X NULL
- X};
- X
- Xstruct MenuItem MenuItem1 = {
- X &MenuItem2,
- X 0,0,
- X 128,8,
- X ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHBOX,
- X 0,
- X (APTR)&IText4,
- X NULL,
- X '.',
- X NULL,
- X MENUNULL
- X};
- X
- Xstruct Menu Menu2 = {
- X NULL,
- X 82,0,
- X 57,0,
- X MENUENABLED,
- X "Tools",
- X &MenuItem1
- X};
- X
- Xstruct IntuiText IText5 = {
- X 3,1,COMPLEMENT,
- X 0,0,
- X NULL,
- X (UBYTE *)" are you sure? ",
- X NULL
- X};
- X
- Xstruct MenuItem SubItem1 = {
- X NULL,
- X 33,3,
- X 120,8,
- X ITEMTEXT+ITEMENABLED+HIGHBOX,
- X 0,
- X (APTR)&IText5,
- X NULL,
- X NULL,
- X NULL,
- X MENUNULL
- X};
- X
- Xstruct IntuiText IText6 = {
- X 3,1,COMPLEMENT,
- X 0,0,
- X NULL,
- X (UBYTE *)"Quit",
- X NULL
- X};
- X
- Xstruct MenuItem MenuItem7 = {
- X NULL,
- X 0,36,
- X 104,8,
- X ITEMTEXT+ITEMENABLED+HIGHBOX,
- X 0,
- X (APTR)&IText6,
- X NULL,
- X NULL,
- X &SubItem1,
- X MENUNULL
- X};
- X
- Xstruct IntuiText IText7 = {
- X 3,1,COMPLEMENT,
- X 0,0,
- X NULL,
- X (UBYTE *)"Write",
- X NULL
- X};
- X
- Xstruct MenuItem MenuItem6 = {
- X &MenuItem7,
- X 0,27,
- X 104,8,
- X ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHBOX,
- X 0,
- X (APTR)&IText7,
- X NULL,
- X 'w',
- X NULL,
- X MENUNULL
- X};
- X
- Xstruct IntuiText IText8 = {
- X 3,1,COMPLEMENT,
- X 0,0,
- X NULL,
- X (UBYTE *)"Save as ",
- X NULL
- X};
- X
- Xstruct MenuItem MenuItem5 = {
- X &MenuItem6,
- X 0,18,
- X 104,8,
- X ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHBOX,
- X 0,
- X (APTR)&IText8,
- X NULL,
- X 's',
- X NULL,
- X MENUNULL
- X};
- X
- Xstruct IntuiText IText9 = {
- X 3,1,COMPLEMENT,
- X 0,0,
- X NULL,
- X (UBYTE *)"Re-read",
- X NULL
- X};
- X
- Xstruct MenuItem MenuItem4 = {
- X &MenuItem5,
- X 0,9,
- X 104,8,
- X ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHBOX,
- X 0,
- X (APTR)&IText9,
- X NULL,
- X 'r',
- X NULL,
- X MENUNULL
- X};
- X
- Xstruct IntuiText IText10 = {
- X 3,1,COMPLEMENT,
- X 0,0,
- X NULL,
- X (UBYTE *)"Load",
- X NULL
- X};
- X
- Xstruct MenuItem MenuItem3 = {
- X &MenuItem4,
- X 0,0,
- X 104,8,
- X ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHBOX,
- X 0,
- X (APTR)&IText10,
- X NULL,
- X 'l',
- X NULL,
- X MENUNULL
- X};
- X
- Xstruct Menu Menu1 = {
- X &Menu2,
- X 0,0,
- X 75,0,
- X MENUENABLED,
- X "Project",
- X &MenuItem3
- X};
- X
- X#define MenuList1 Menu1
- X
- Xstruct NewWindow NewWindowStructure1 = {
- X 485,50,
- X 155,31,
- X 0,2,
- X GADGETUP+MENUPICK+CLOSEWINDOW,
- X WINDOWDRAG+WINDOWCLOSE+ACTIVATE,
- X &g_Record,
- X NULL,
- X (UBYTE *)" MIDI Recorder ",
- X NULL,
- X NULL,
- X 5,5,
- X 640,200,
- X WBENCHSCREEN
- X};
- X
- X
- Xvoid HandleEvent(object)
- XAPTR object;
- X{
- X if (object == (APTR)&g_Record) { Record(object); return; }
- X if (object == (APTR)&g_Rewind) { Rewind(object); return; }
- X}
- X#define HANDLEEVENT HandleEvent
- X
- X/* end of PowerWindows source generation */
- END_OF_FILE
- if test 3339 -ne `wc -c <'src/RecPOW.c'`; then
- echo shar: \"'src/RecPOW.c'\" unpacked with wrong size!
- fi
- chmod +x 'src/RecPOW.c'
- # end of 'src/RecPOW.c'
- fi
- echo shar: End of archive 1 \(of 1\).
- cp /dev/null ark1isdone
- MISSING=""
- for I in 1 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have the archive.
- rm -f ark[1-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
- --
- Mail submissions (sources or binaries) to <amiga@uunet.uu.net>.
- Mail comments to the moderator at <amiga-request@uunet.uu.net>.
- Post requests for sources, and general discussion to comp.sys.amiga.
-